// MyPromise测试
const MyPromise = require('./4-test')

const promise = new MyPromise((resolve, reject)=>{
    // setTimeout(()=>{
    //     resolve('async success')
    //     reject('async error')
    // }, 1000)
    resolve('success')
    // reject('error')
    console.log(resolve, reject)
})

const promise2 = new MyPromise((resolve, reject)=>{
    resolve('success promise2')
})

promise.then(value=>{
    console.log(value)
    // return promise
}, reason=>{
    console.log(reason)
    return 'error1'
})